package com.infotel.cartegrise.listeners;

import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.JRadioButton;

public class RadioProprietaireListener implements ActionListener {

    JPanel panneauCard;

    public RadioProprietaireListener(JPanel panneauCard) {
        this.panneauCard = panneauCard;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        String radioButtonName = ((JRadioButton) e.getSource()).getName();
        CardLayout cl = (CardLayout) (panneauCard.getLayout());
        cl.show(panneauCard, radioButtonName);
    }

}
